﻿Imports System.IO

Public Class galleria
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Dim di As New DirectoryInfo(Server.MapPath("~/jQueryGalleria/imagens"))
        DataList1.DataSource = di.GetFiles
        DataList1.DataBind()

        For Each file As FileInfo In di.GetFiles()
            Dim novaImg As String = file.Name
            Me.galleria.InnerHtml &= "<img src='imagens/" & novaImg.Replace("\", "/") & "' alt='" & novaImg & "'/>"
        Next

    End Sub

End Class